package sb.simple.rest_template;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class ReceiveController {


    @GetMapping("gfe1r")
    @ResponseBody
    public String gfe1(String name, String pass) {
        return "hello[get] gfe1, name:" + name + ", pass:" + pass;
    }

    @PostMapping("pfe1r")
    @ResponseBody
    public String pfe1(@RequestBody JSONObject jsonObject) {
        String name = jsonObject.getString("name");
        String pass = jsonObject.getString("pass");
        return "hello[post] pfe1r, name:" + name + ", pass:" + pass;
    }

}
